# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=grilo-plugins
pkgver=0.3.4+13+gf460a00
pkgrel=1
pkgdesc="A collection of plugins for the Grilo framework"
url="https://git.gnome.org/browse/grilo-plugins"
arch=(i686 x86_64)
license=(LGPL)
depends=(grilo lua libmediaart libgdata libtracker-sparql gom libdmapsharing chromaprint
         gst-plugins-bad)
makedepends=(git meson gperf)
checkdepends=(gst-plugins-good gst-plugins-base)
optdepends=('dleyna-server: DLNA plugin'
            'tracker: Tracker plugin')
groups=(gnome)
_commit=f460a00bea4dcb91c6da9dd79caba463bc57b56a  # master
source=("git+https://git.gnome.org/browse/grilo-plugins#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^grilo-plugins-//;s/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
  # Fixup tag mess
  git tag -f grilo-plugins-0.3.4 37811929314abfe14e132a206980acd3e5bba36d
}

build() {
  cd build
  export LANG=en_US.UTF-8
  meson --prefix=/usr --buildtype=plain ../$pkgname
  ninja
}

check() {
  cd build
  ninja test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
